package com.example.designpattenexample.factorymethod.example;

public class Client {
    public static void main(String[] args) {
        FruitFactory appleFactory = new AppleFactory();
        Fruit apple = appleFactory.factory();
        apple.plant();
        apple.grow();
        apple.harvest();
        FruitFactory grapeFactory = new GrapeFactory();
        Fruit grape = grapeFactory.factory();
        grape.plant();grape.grow();grape.harvest();
        System.out.println("==========================");
        FruitGarden garden = new ConcreteFruitGarden();
        Apple apple1 = garden.factory(Apple.class);
        Grape grape1 = garden.factory(Grape.class);
        apple1.plant();apple1.grow();apple1.harvest();
        grape1.plant();grape1.grow();grape1.harvest();
    }
}
